package ren.colorful.learnJava.nio;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.Socket;
import java.net.UnknownHostException;

public class TestReactor {
	
	public void testConnect() throws UnknownHostException, IOException{
		Socket socket = new Socket("localhost",4700);
		System.out.println("连接成功");
		BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(socket.getInputStream()));
		PrintWriter printWriter = new PrintWriter(socket.getOutputStream(),true);
		printWriter.println("hi");
		printWriter.flush();
		byte[] buf = new byte[2048];
		System.out.println("准备读取数据~~");
		while(true){
			
		}
		
	}
}
